<?php
/*
 * Created on 03.01.2006
 *
 */
 
class c_setHandler 
{

    function startElement (& $sender, $attrs)
    {
        if (!$attrs['value'])
        {
            die ("Attribute value is missing in set tag\n");
        }
        if (!$attrs['var'])
        {
            die ("Attribute var is missing in set tag\n");
        }
        $var = substr($attrs['var'], 1, strlen($attrs['var'])-2);
        if (!preg_match('/\w+/', $var))
            die ("Attribute var must not contain EL code\n");
        $var = '$'.$var;
        $sender->appendCode($var.' = '.$attrs['value'].';'."\n");
    }
    
    function endElement (& $sender)
    {
    
    }

}

?>
